package top.jafar.data.structures.expression;

import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.util.Stack;

public class OperationDemo {
    public static void main(String[] args) {
//        printOk("3+2-5");
//        printOk("3+2*6-5");
//        printOk("3+2*(6-5)+2");
        // 8 5 - 6 * 2 * 3 + 2 +
        // "3+2*(6*(8-5))+2"
        printOk("3+2*(6*(8-5))+2");
        printOk("1+((2+3)*4)-5");
//        printOk("3+2*(6*(8-5))+2");
        printLogic("");
    }

    static final ArithmeticOperator OPERATOR = new ArithmeticOperator();

    public static void printLogic(String express) {
        System.out.println(express + " = "+OPERATOR.execute(express));
    }

    public static void printOk(String str) {
        System.out.println(str + " = " + OPERATOR.execute(str));
    }
}
